package cn.hgd11.security.controller;


import cn.hgd11.security.common.CommonResult;
import cn.hgd11.security.entity.SysUser;
import cn.hgd11.security.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户信息表 前端控制器
 * </p>
 *
 * @author kaige.wang
 * @since 2022-03-10
 */
@RestController
@RequestMapping("/sys-user")
@Slf4j
public class SysUserController {

    @Autowired
    private SysUserService sysUserService;

    @PostMapping
    public CommonResult<Integer> createUser(
            @RequestBody SysUser user
    ) {
        log.info("创建用户，user={}", user);
        return sysUserService.createUser(user);
    }
}

